#ifndef __ISTATEHANDLER_H__
#define __ISTATEHANDLER_H__

#include "PowerLibraryEngine.h"

#define STATE_NOT_INIT			0
#define STATE_START				1
#define STATE_END				2
#define STATE_RESERVED			0x10000000

class IStateHandler
{
protected:
    u32 StateID;
public:
    IStateHandler():StateID(STATE_NOT_INIT)
    {
    }

    virtual ~IStateHandler()					{}

    virtual s32 EnterState()					= 0;
    virtual s32 ExitState()						= 0;
    virtual s32 Update()						= 0;

    inline void SetState(u32 NewState)
    {
        StateID = NewState;
    }

    inline u32 GetState()
    {
    	return StateID;
    }

    inline bool IsEnded()
    {
    	return StateID == STATE_END;
    }
};

#endif
